@tool
class_name ControllerCommand
extends Resource

#region 属性
@export var command_type:GameEnum.ControllerCommandType
@export var command_tag_conflict_resolution:GameEnum.ControllerCommandTagConflictResolution
@export var priority:int
@export var duration:float = 0
@export var max_handle_count:int = 1
@export var condition:Condition
## 该命令被删除时是否触发deactive方法
@export var is_excute_deactive_when_remove:bool = true
var id:int = -1
var activate_tick:int = -Constant.INT_MAX
# 处理次数
var handle_count:int = 0
#endregion
#region 字段
#endregion
#region 信号
#endregion

#region 基类方法
#endregion
#region 公共方法
func activate(controller:ControllerComponent,command_dict_by_tag:Dictionary) -> bool:
	return condition.check_result(controller.entity) if condition else true
func deactivate(controller:ControllerComponent,command_dict_by_tag:Dictionary):
	pass
#endregion
#region 私有方法
#endregion
#region 生命周期函数
func _init() -> void:
	if Engine.is_editor_hint():
		resource_local_to_scene = true
#endregion
